				var Calculator = {					
					field : 'zahl1',
					obj : null,					
					init : function () {
						this.obj = document.getElementById("anzeige");
						this.updateDisplay();
					},					
					setOperator : function ( userOperator ) {
						if (this.field != "zahl2") {
							document.calculator.operator.value = userOperator;
							this.field = 'zahl2';
							this.updateDisplay();
						}
					},
					set : function ( num ) {
						var actVal = document.calculator[this.field].value;
						if (parseInt(actVal) == 0) {
							actVal = num;
						} else {
							actVal += "" + num;
						}
						document.calculator[this.field].value = actVal;
						this.updateDisplay();
					},					
					updateDisplay : function ( element ) {
						if (typeof(element) != "object") {
							element = document.calculator[this.field];
						}
						this.obj.innerHTML = element.value;
					},
					setAccidental : function () {
						document.calculator[this.field].value *= -1;
						this.updateDisplay();
					},
					setComma : function () {
						var actVal = document.calculator[this.field].value;
						if (parseInt(actVal) != 0 && document.calculator[this.field].value.indexOf(".") == -1) {
							document.calculator[this.field].value += ".";
							this.updateDisplay();
						}
					},
					resetFields : function ( current ) {
						if (!current) {
							this.field = 'zahl1';
							document.calculator.operator.value = "";
							document.calculator['zahl1'].value = 0.0;
							document.calculator['zahl2'].value = 0.0;
						} else {
							document.calculator[this.field].value = 0.0;
						}
						this.updateDisplay();
					}
				};